/**
 * 
 */
package com.google.code.netz.wfe.events;

import com.google.code.netz.wfe.model.Place;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @since 1.0
 * @version $Id$
 */
public class PlaceEvent<T extends Place<?>> extends TypedEvent<T> {

	public enum PlaceEventType implements IEventType {

		/**
		 * Implies that a IToken has been added to a Place.
		 */
		TOKEN_ADDED("IToken Added"),

		/**
		 * Implies that a IToken has been removed from a Place.
		 */
		TOKEN_DELETED("IToken Deleted");

		/**
		 * Place event expressed as string.
		 */
		private String type;

		/**
		 * @param type
		 */
		private PlaceEventType(String type) {
			this.type = type;
		}

		@Override
		public String asString() {
			return type;
		}

		/*
		 * (non-Javadoc)
		 * 
		 * @see com.google.code.netz.wfe.events.IEventType#allEventTypes()
		 */
		@Override
		public IEventType[] allEventTypes() {
			return values();
		}

	}

	/**
	 * 
	 * @param source
	 * @param type
	 */
	public PlaceEvent(T source, IEventType type) {
		super(source, type);
	}

}
